import 'package:icooker/model/meaildetail/MealDetailData.dart';
import 'package:icooker/model/reommend_data.dart';

/// 实体工厂
/// http://events.jianshu.io/p/3c50812865d1
class EntryFactory {
  static T? generateOBJ<T>(json) {
    if (T.toString() == "RecommendData") {
      // 解析数据
      return RecommendData.fromJson(json) as T;
    } else if (T.toString() == "MealDetailData") {
      return MealDetailData.fromJson(json) as T;
    }
    return null;
  }
}
